.cookie-consent-preview {
    position: relative;
    overflow: hidden;

    img {
        width: 100%;
        height: auto;
        cursor: pointer;
    }

    p {
        cursor: pointer;
        text-align: center;
    }

    img ~ p {
        position: absolute;
        top: 40%;
        right: 0;
        left: 0;
        background-color: rgba(255, 255, 255, 0.8);
        color: #333;
        padding: 4px 10px;
        margin: 0;
        text-overflow: ellipsis;
    }
}

.cookie-consent {
    width: 100%;
    max-height: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    overflow: auto;
    z-index: 9999;
    color: white;

    p {
        max-width: 85ch;
    }

    ul {
        padding: 0;
        list-style: none;
    }

    a {
        color: currentColor;

        &:hover {
            text-decoration: none;
        }
    }
}

.cookie-consent__upper,
.cookie-consent__lower {
    padding: 2rem 5%;
}

.cookie-consent__upper {
    background-color: #3c3f46;
}

.cookie-consent__lower {
    background-color: #585d68;
}

.cookie-consent__upper__controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.cookie-consent-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 16px 0;
    margin: 0 auto 0 0;
    transition: opacity 0.2s;
    font-weight: 500;
    background: none;
    border: none;
    white-space: nowrap;

    img {
        transform: rotate(90deg);
    }

    &:after {
        content: '';
        display: inline-block;
        width: 0.5em;
        height: 0.5em;
        margin-left: 1rem;
        border-top: 2px solid transparent;
        border-right: 2px solid #fff;
        border-bottom: 2px solid #fff;
        border-left: 2px solid transparent;
        transform: rotate(45deg) translateY(-30%);
    }
}

.cookie-options {
    display: flex;
    flex-flow: row wrap;
    margin: 0 0 2em;

    li {
        position: relative;

        + li {
            margin-left: 1em;
        }
    }

    input[type="checkbox"] {
        position: absolute;
        opacity: 0;

        &:focus + label:before {
            outline: 2px dotted white;
            outline-offset: 2px;
        }

        &:disabled:checked + label:before {
            border: 2px solid grey;
            background-color: grey;
        }
    }

    input[type="checkbox"]:checked + label {
        &:before {
            transform: rotate(90deg);
        }

        &:after {
            opacity: 1;
        }
    }

    label {
        display: flex;
        align-items: center;
    }

    label:before {
        content: "";
        flex-shrink: 0;
        display: inline-block;
        width: 25px;
        height: 25px;
        margin-right: 1em;
        position: relative;
        top: 0;
        border: 2px solid #fff;
        transition: all 0.3s;
    }

    label:after {
        content: "";
        flex-shrink: 0;
        width: 8px;
        height: 13px;
        opacity: 0;
        position: absolute;
        top: 5px;
        left: 10px;
        border-bottom: 2px solid #fff;
        border-right: 2px solid #fff;
        transform: rotate(35deg);
    }
}

.cookie-options-accept {
    display: flex;
    margin-top: 2em;
}